@extends('model/admin')

@section('title','添加新闻公告')

@section('content')

<div class="mws-panel grid_8">
    <div class="mws-panel-header">
        <span>添加新闻公告</span>
    </div>
    <div class="mws-panel-body no-padding">
    @if (count($errors) > 0)
		<div class="mws-form-message error">
	        <ul>
	            @foreach ($errors->all() as $error)
	                <li>{{ $error }}</li>
	            @endforeach
	        </ul>
	    </div>
	@endif
	<form action="/admin/news/update" method='post' class="mws-form" enctype='multipart/form-data'>
		<div class="mws-form-inline">
			<div class="mws-form-row">
				<label class="mws-form-label">新闻标题:<span class="required">*</span></label>
				<div class="mws-form-item">
					<input type="text" class="small" name='title' value="{{$res['title']}}">
				</div>
			</div>
			<div class="mws-form-row">
				<label class="mws-form-label">新闻作者:<span class="required">*</span></label>
				<div class="mws-form-item">
					<input type="text" class="small" name='author' value="{{$res['author']}}">
				</div>
			</div>
			<div class="mws-form-row">
                <label class="mws-form-label">新闻类型 <span class="required">*</span></label>
                <div class="mws-form-item">
                    <ul class="mws-form-list">
                        <li>
                        <input type="radio" class="required" name="type" id="male" value="新闻" @if($res['type'] == '新闻') checked='checked' @endif> 
                        <label for="male">新闻</label>
                        <input type="radio" class="required" name="type" id="male" value="公告" @if($res['type'] == '公告') checked='checked' @endif>
                        <label for="female">公告</label>
                        <input type="radio" class="required" name="type" id="male" value="特惠" @if($res['type'] == '特惠') checked='checked' @endif> 
                        <label for="male" >特惠</label>
                        </li>
                    </ul>
                    <label style="display:none" for="gender" generated="true" class="error plain"></label>
                </div>
            </div>

            <div class="mws-form-row">
                <label class="mws-form-label">新闻内容<span class="required">*</span></label>
                <div class="mws-form-item">
                	<textarea class="required large" name="content" style='width:450px'>{{$res['content']}}</textarea>
                </div>
            </div>
			
		</div>
		<div class="mws-button-row">
			{{csrf_field()}}
			<input type="hidden" name="id" value="{{ $res['id'] }}">
			<input type="submit" class="btn btn-danger" value="修改新闻">
			<input type="reset" class="btn " value="重　置">
		</div>
	</form>
    </div>    	
</div>

@endsection



